﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LBattleFacade
{
    private static LBattleFacade _instance;
    public static LBattleFacade Instance
    {
        get
        {
            if (_instance == null)
                _instance = new LBattleFacade();
            return _instance;
        }
    }



    private BattleSystem battleSystem = null;
    private RoundSystem roundSystem = null;
    private CharacterSystem characterSystem = null;

    public bool isPlayAniming;

    private LBattleFacade()
    { }

    public void Initinal()
    {

        battleSystem = new BattleSystem(this);
        roundSystem = new RoundSystem(this);
        characterSystem = new CharacterSystem(this);

    }

    public void Release()
    {
        battleSystem.Relese();
        roundSystem.Relese();
        characterSystem.Relese();
    }
    // 更新
    public void Update()
    {
        // 玩家輸入
        // InputProcess();

        // 遊戲系統更新
        battleSystem.Update();
        characterSystem.Update();
        roundSystem.Update();

    }

    public CharacterObj GetLeftHeroObj()
    {
        return characterSystem.getLeftCharacter();
    }
    public CharacterObj GetRightHeroObj()
    {
        return characterSystem.getRightCharacter();
    }

    public void CreatCharacter()
    {
        if(characterSystem!=null)
            characterSystem.Relese();

        characterSystem.Init();
    }

    public void CreatRound()
    {
        if (roundSystem != null)
            roundSystem.Relese();

        roundSystem.Init();
    }

}

